/**
 * @file   MyExcept.h
 * @author xingyifan <xingyifan@xingyifan-VirtualBox>
 * @date   Tue Jul 13 19:47:07 2021
 * 
 * @brief  my except
 * 
 * 
 */

#include "error.h"

using namespace std;

class MyExcept {
private:
    string type;
    int code;
public:
    MyExcept(int codeNum) {
	code = codeNum;
	switch (code) {
	case ARRAY_BOUND: type = "Array bound!"; break;
	case VECTOR_LENGTH: type = "You want to change the length of the vector!"; break;
	case NOT_A_SQUARE: type = "The Matrix is not a square!"; break;
	defulat: type = "Something wrong!"; break;
	}
    }
    void what () const {
	cerr << type << endl;
    }
};
